package org.jeecg.glr.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.glr.entity.GlrLightPole;

/**
 * @Description: 路灯灯杆管理
 * @Author: jeecg-boot
 * @Date:   2020-03-05
 * @Version: V1.0
 */
public interface GlrLightPoleMapper extends BaseMapper<GlrLightPole> {

    @Select("SELECT IFNULL(max(code),'0') as maxcode from glr_light_pole WHERE project_code=#{projectCode}")
    int getMaxCodeByProjectCode(@Param("projectCode")String projectCode);

    @Update("UPDATE glr_light_pole SET ${FIELD_YN}=#{YN} WHERE code=#{code} AND project_code=#{projectCode}")
    int updateFieldYnByCodeAndProjectCode(
            @Param("FIELD_YN")String FIELD_YN,@Param("YN")String YN,
            @Param("code")String code,
            @Param("projectCode")String projectCode);


    @Select("${sql}")
    GlrLightPole getGlrLightPoleSelect(@Param("sql")String sql);

    @Update("${updateSql}")
    int updateSql(@Param("updateSql")String updateSql);
}
